<template>
  <n-config-provider
    :theme="appStore.isDarkTheme ? darkTheme : null"
    :locale="lang"
    :date-locale="dateLang"
  >
    <n-dialog-provider>
      <n-message-provider>
        <router-view />
      </n-message-provider>
    </n-dialog-provider>
  </n-config-provider>
</template>
<script setup lang="ts">
import { darkTheme, zhCN, dateZhCN, enUS, dateEnUS } from 'naive-ui'

const appStore = useAppStore()
let lang = computed(() => (appStore.language === _Language.enUS ? enUS : zhCN))
let dateLang = computed(() => (appStore.language === _Language.enUS ? dateEnUS : dateZhCN))
</script>
